import { restService } from '@/apis/rest';
import { createStore } from 'vuex';

import models from './models';
import { IWebsite } from './types';

export interface RootState {
  version: string;
  website: IWebsite;
}

export default createStore<RootState>({
  state: {
    version: '1.0.0',
    website: {}
  },
  getters: {
  },
  mutations: {
    async _getAndSetWebsiteInfo(state) {
      state.website = await restService('website').get();
    },

  },
  actions: {
  },
  modules: {
    ...models
  }
})
